//
//  CommentCell.m
//  LoveTrail
//
//  Created by giantumbrella on 15/6/25.
//  Copyright (c) 2015年 赵娟. All rights reserved.
//

#import "CommentCell.h"
#import "CommonMacro.h"
@interface CommentCell ()
@property (nonatomic,strong) UILabel *nameLabel;
@property (nonatomic,strong) UILabel *timeLabel;
@property (nonatomic,strong) UILabel *briefLabel;
@property (nonatomic,strong) UILabel *typeLabel;

@end
@implementation CommentCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addCommentCell];
    }
    return self;
}

- (void)addCommentCell
{
    CGFloat labelX = 5;
    CGFloat labelY = 5;
    CGFloat labelW = SCREEN_WIDTH*0.5;
    CGFloat labelH = self.frame.size.height*0.2;
    //1.昵称
   self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(labelX, labelY, labelW, labelH)];
   [self addSubview:self.nameLabel];
    self.nameLabel.backgroundColor = [UIColor redColor];
    self.nameLabel.text = @"Amy";
    
    //2.正文
    self.briefLabel = [[UILabel alloc] initWithFrame:CGRectMake(labelX+5, self.nameLabel.frame.size.height+self.nameLabel.frame.origin.y, self.frame.size.width-labelX*4, self.frame.size.height*0.7)];
    [self addSubview:self.briefLabel];
    self.briefLabel.text = @"the stoty goes that some time ago  a man puished his 3 - year -old daughter for wasting  a roll of gold wrapping paper Money was tight and he became";
    
    //3.时间
    self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(labelX, self.briefLabel.frame.size.height+self.briefLabel.frame.origin.y, self.frame.size.width*0.4, self.frame.size.height*0.2)];
    [self addSubview:self.timeLabel];
    self.timeLabel.text = @"2015-06-02 16:21";
    
    //4.分类
    self.typeLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.timeLabel.frame.size.width+self.timeLabel.frame.origin.x, self.timeLabel.frame.origin.y, self.frame.size.width*0.3, self.timeLabel.frame.size.height)];
    [self addSubview:self.typeLabel];
    self.typeLabel.text = @"分类：草莓味";
}

- (void)layoutSubviews
{

}
@end
